import java.util.*;

public class phone {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        System.out.print("请输入电话号码：");
        String phone = s.nextLine();
        Map<Character, Integer> map = new HashMap<>();
        for (char c : phone.toCharArray()) {
            if (map.containsKey(c)) {
                map.put(c, map.get(c) + 1);
            } else {
                map.put(c, 1);
            }
        }
        char maxChar = '0';
        int maxCount = 0;
        for (Map.Entry<Character, Integer> entry : map.entrySet()) {
            if (entry.getValue() > maxCount) {
                maxChar = entry.getKey();
                maxCount = entry.getValue();
            }
        }
        String result = phone.replace(maxChar, '8');
        System.out.println("替换后的电话号码为：" + result);
    }
}